﻿using SDF.Core.Domain.Customers;
using SDF.Web.Framework;
using SDF.Web.Framework.Kendoui;
using SDF.Web.Framework.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SDF.Plugin.Misc.DynamicEntity.Extensions;
using SDF.Services.Helpers;
using System.Web.Mvc;
using System.Web.Script.Serialization;
using FluentValidation.Attributes;
using SDF.Plugin.Misc.DynamicEntity.Validators.DynamicEntity;

namespace SDF.Plugin.Misc.DynamicEntity.Models
{
    [Validator(typeof(DynamicEntityHeaderValidator))]
    public class DynamicEntityHeaderModel : BaseSDFEntityModel
    {
        public DynamicEntityHeaderModel()
        {
            //this.Fields = new List<DynamicEntityItemModel>();
        }

        [SDFResourceDisplayName("Plugins.Misc.DynamicEntity.Description")]
        public string Description { get; set; }

        [SDFResourceDisplayName("Plugins.Misc.DynamicEntity.SAPInstance")]
        public string SAPInstance { get; set; }

        [SDFResourceDisplayName("Plugins.Misc.DynamicEntity.LimitedToProjects")]
        public bool LimitedToProjects { get; set; }

        [SDFResourceDisplayName("Plugins.Misc.DynamicEntity.CodeName")]
        public string CodeName { get; set; }

        [SDFResourceDisplayName("Plugins.Misc.DynamicEntity.Name")]
        public string Name { get; set; }

        [SDFResourceDisplayName("Plugins.Misc.DynamicEntity.Delete")]
        public bool Delete { get; set; }

        [SDFResourceDisplayName("Plugins.Misc.DynamicEntity.CreateTimeOnUtc")]
        public DateTime CreateTimeOnUtc { get; set; }

        [SDFResourceDisplayName("Plugins.Misc.DynamicEntity.Creator")]
        public virtual Customer Customer { get; set; }

        [ScriptIgnore]
        [SDFResourceDisplayName("Plugins.Misc.DynamicEntity.Fields")]
        public IList<DynamicEntityItemModel> Fields { get; set; }
    }
}